import { TTaskTalk } from "../../../Message/Db/Tables/TTaskTalk";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class DialogConfig
    
    export  class DialogConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (DialogConfig._instance != null) 
            {
                throw new Error(" DialogConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TTaskTalk();
                loc1.talkId = loc2.talkId;
                loc1.talkStr = StringHelper.getString(loc2.talkStr);
                this._map[loc1.talkId] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_task_talk.json");
            this.write(loc1);
            return;
        }

        public getDialogById(arg1: int): TTaskTalk
        {
            return this._map[arg1];
        }

        public static get instance(): DialogConfig
        {
            if (DialogConfig._instance == null) 
            {
                DialogConfig._instance = new DialogConfig();
            }
            return DialogConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: DialogConfig;
    }
